import { useEffect} from "react";
import { Route, Routes ,useNavigate} from "react-router-dom";
import Home from "../home";
import Login from "../login";
const Router = () => {
    const nav = useNavigate();
    useEffect(() => {
        console.log('执行了');
        console.dir(nav)
        nav('/login',{replace:true});
    },[])
    
    
    
    return (
        <Routes>
            <Route path="/login" element={<Login />} />
            <Route path="*" element={<Home />} />
        </Routes>
    );
};

export default Router;
